<template>
  <el-container>
    <el-header>
      <div>后台管理</div>
      <el-button @click="logout">退出</el-button>
    </el-header>
    <el-container>
      <el-aside width="200px">Aside</el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  components: {},
  methods: {
    logout() {
      window.sessionStorage.removeItem('token');
      this.$router.push('/login');
    }
  }
};
</script>

<style lang="less">
.el-container,
.home {
  height: 100%;
}
.el-header {
  background-color: pink;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.el-aside {
  background-color: skyblue;
}
.el-main {
  background-color: #ececec;
}
</style>
